package com.neusoft.ysu.his.controller;


import com.neusoft.ysu.his.entity.CommonResult;
import com.neusoft.ysu.his.entity.Manager;
import com.neusoft.ysu.his.entity.Register;
import com.neusoft.ysu.his.service.IManagerService;
import org.apache.ibatis.annotations.Select;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.io.UnsupportedEncodingException;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 作者：赵子鉴
 * @since 2023-08-29
 */
@RestController
@RequestMapping("/manager")
@CrossOrigin
public class ManagerController {
    @Autowired
    IManagerService managerService;
    @PutMapping("/insert")
    public CommonResult insert(@RequestBody Manager manager) throws UnsupportedEncodingException {
        manager.setId(0);
        manager.setDelmark(0);
        return managerService.insert(manager);
    }
    @PostMapping("/q/login")
    public CommonResult loginCheck(@RequestBody Manager manager) throws UnsupportedEncodingException {
        return managerService.loginCheck(manager);
    }
}
